package com.kk.score.service.impl;

import com.kk.score.entity.DepartmentEntity;
import com.kk.score.entity.vo.PositionVo;
import com.kk.score.utils.PageUtils;
import com.kk.score.utils.Query;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.kk.score.dao.PositionDao;
import com.kk.score.entity.PositionEntity;
import com.kk.score.service.PositionService;
import org.springframework.util.StringUtils;


@Service("positionService")
public class PositionServiceImpl extends ServiceImpl<PositionDao, PositionEntity> implements PositionService {

    @Autowired
    private PositionDao positionDao;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        String status = (String) params.get("status");
        if (!StringUtils.hasText(status)) {
            status = "1";
        }
        return new PageUtils(positionDao.findPositionPage(new Query<PositionVo>().getPage(params), status));
    }

}